home *** CD-ROM | disk | FTP | other *** search
/ CD Ware Multimedia 1995 May / cd Ware (Juegos) Epimundo.iso / DOS / C / COP.ZIP / RECTPIE.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1992-07-20  |  766 b   |  35 lines

  1. #include "rectpie.hpp"
  2.  
  3.  
  4. void Rectangle::show(int xxpose, int yxpose,
  5.     unsigned scale)
  6. {
  7.     int poly[10];
  8.     int dw = (int)(width/2*scale);
  9.     int dh = (int)(heighth/2*scale);
  10.     int l  = (int)getx()+xxpose - dw;
  11.     int t  = (int)gety()+yxpose - dh;
  12.     int r  = (int)getx()+xxpose + dw;
  13.     int b  = (int)gety()+yxpose + dh;
  14.  
  15.     poly[0] = l;  poly[1] =  t;
  16.     poly[2] = r;  poly[3] =  t;
  17.     poly[4] = r;  poly[5] =  b;
  18.     poly[6] = l;  poly[7] =  b;
  19.     poly[8] = l;  poly[9] =  t;
  20.  
  21.     drawpoly(5,poly);
  22. }
  23.  
  24.  
  25. void PieSlice::show(int xxpose, int yxpose,
  26.     unsigned scale)
  27. {
  28.     pieslice((int)getx()+xxpose,
  29.         (int)gety()+yxpose,
  30.         (int)startAngle,(int)endAngle,
  31.         (int)(radius*scale));
  32.     // radius is in Circle protected scope so it
  33.     // is accessible from PieSlice
  34. }
  35.